<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.0.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#dropoutMember").click(function(){
			if($("#password").val()==""){
				alert("비밀번호를 입력하세요");
				return false;
			}
			
			// 회원탈퇴시 password 확인하여 탈퇴처리 
			$.ajax({
				type:"POST",
				url:"checkPassword.ju",
				data:"id="+$("#id").val()+"&password="+$("#password").val(),
				success:function(data){	
					if(data.flag==false){
				//	$("#idCheckView").html("비밀번호 다릅니다");
					alert("비밀번호 다릅니다");
					}else{
					//	$("#idCheckView").html(" 비밀번호가 확인 완료");					
					//alert(" 비밀번호가 확인 완료");
					if(confirm("탈퇴를 하시겠습니까?")){
					location.href="dropoutMember.ju?id="+$("#id").val();
						}
					}
					status=data.flag;
				}//callback			
			});//ajax
		}); //submit
	});//ready
</script>
</head>
<body>
<%--  <form method="post" id="dropoutMemberForm">
       <table style="border: 1px dashed #aaaaaa; width: 560px;" cellpadding="0" cellspacing="0" align="center">
        <h2 align="center"><br>회원탈퇴 <br><br></h2>	
        
        <tr height="45">
    
         <td width="130" align="center">아이디</td>
         <td><input type="text"  size="20" id="id" value="${sessionScope.mvo.id }" readonly="readonly" name="id"></td>
       </tr>
       
               <tr height="45">
         <td width="90" align="center">닉네임</td>
         <td><input type="text"  size="20" id="nickname" value="${sessionScope.mvo.nickname}" readonly="readonly"></td>
       </tr>

       <tr height="45">
         <td align="center">비밀번호확인</td>
         <td><input type="password" name="password" size="20" id="password" ></td>
        </tr>

         <tr align="center" style="background-color: #ccc;">
         <td colspan="3" height="30">
         <input type="button" value="회원탈퇴" id="dropoutMember">
           <input type="reset" value="취소"></td>
        </tr>
       </table>
  </form>  --%>
  <form class="form-horizontal" role="form" method="post" id="dropoutMemberForm">
    <h2 align="center">회원탈퇴</h2>
    <div class="form-group">
        <label class="col-sm-1 col-sm-offset-3 control-label"></label>
        <div class="col-sm-5">
           아이디 <input type="text" id="id" value="${sessionScope.mvo.id }" readonly="readonly" name="id" class="form-control"/>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-1 col-sm-offset-3 control-label"></label>
        <div class="col-sm-5">
           닉네임 <input type="text" id="nickname" value="${sessionScope.mvo.nickname}" readonly="readonly" class="form-control"/>
        </div>
    </div>
   <td>
    <div class="form-group">
        <label class="col-sm-1 col-sm-offset-3 control-label"></label>
        <div class="col-sm-5">
         비밀번호  <input type="password" name="password" id="password"placeholder="Password Confirm" class="form-control"/>
        </div>
    </div>
 
    <br/>
          <div class="form-group">
    <label class="col-sm-1 col-sm-offset-3 control-label"></label>
    <div class="col-sm-5" class="form-control">
    <input type="reset" value="취소" class="btn btn-default">
     <input type="button" value="회원탈퇴" id="dropoutMember" class="btn btn-primary">
      </div>
    </div>
</form>

</body>
</html>